﻿using System;
using System.Data;
using System.Collections.Generic;
using ElingOA6_Admin_DSJCJ.Model;
namespace ElingOA6_Admin_DSJCJ.BLL
{
    /// <summary>
    /// ItemPurchaseEntry
    /// </summary>
    public partial class ItemPurchaseEntry
    {
        private readonly ElingOA6_Admin_DSJCJ.DAL.ItemPurchaseEntry dal = new ElingOA6_Admin_DSJCJ.DAL.ItemPurchaseEntry();
        public ItemPurchaseEntry()
        { }
        #region  BasicMethod
     
        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public ElingOA6_Admin_DSJCJ.Model.ItemPurchaseEntry GetModel(decimal FItemPurchaseEntryID)
        {

            return dal.GetModel(FItemPurchaseEntryID);
        }

        /// <summary>
        /// 获得数据列表
        /// </summary>
        public DataSet GetList(string strWhere)
        {
            return dal.GetList(strWhere);
        }
     
        /// <summary>
        /// 获得数据列表
        /// </summary>
        public List<ElingOA6_Admin_DSJCJ.Model.ItemPurchaseEntry> GetModelList(string strWhere)
        {
            DataSet ds = dal.GetList(strWhere);
            return DataTableToList(ds.Tables[0]);
        }
        /// <summary>
        /// 获得数据列表
        /// </summary>
        public List<ElingOA6_Admin_DSJCJ.Model.ItemPurchaseEntry> DataTableToList(DataTable dt)
        {
            List<ElingOA6_Admin_DSJCJ.Model.ItemPurchaseEntry> modelList = new List<ElingOA6_Admin_DSJCJ.Model.ItemPurchaseEntry>();
            int rowsCount = dt.Rows.Count;
            if (rowsCount > 0)
            {
                ElingOA6_Admin_DSJCJ.Model.ItemPurchaseEntry model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = dal.DataRowToModel(dt.Rows[n]);
                    if (model != null)
                    {
                        modelList.Add(model);
                    }
                }
            }
            return modelList;
        }

        /// <summary>
        /// 获得数据列表
        /// </summary>
        public DataSet GetAllList()
        {
            return GetList("");
        }

      
        #endregion  BasicMethod
        #region  ExtensionMethod

        #endregion  ExtensionMethod
    }
}

